<template>
    <div class="mobile clearfix">
      <MobileHeader />
      
      <div class="article-list-mobile detail clearfix">
        <div class="main clearfix">
          <div class="content clearfix" v-html="article.wenznr" v-if="article.wenznr != null">
          </div>
        </div>
        
        <div class="r-top rad3" v-on:click="back">
          <i class="iconfont icon-fanhuidingbu"></i>
          <a>返回上级</a>
        </div>
      </div>
      <MobileFooter />
    </div>
  </template>
  
  <script>
  import MobileHeader from './MobileHeader.vue'
  import MobileFooter from "./MobileFooter";
  import _http from "../httpService";
  
  export default {
    components: {
      MobileHeader,
      MobileFooter
    },
    data() {
      return {
        article: {}
      };
    },

    created() {
        this.article = JSON.parse(localStorage.getItem('wenzxq')); 
    },

    methods: {
      progress(number) {
        this.pdf_loading_progress = number;
      },
      back() {
        this.$router.go(-1);//返回上一层
      },
      backToTop() {
        let distanceY = window.pageYOffset;
        let i = 0;
        this.interval = setInterval(() => {
          let next = Math.floor(
            this.easeInOutQuad(10 * i, distanceY, -distanceY, 500)
          );
          if (next <= this.backPosition) {
            window.scrollTo(0, this.backPosition);
            clearInterval(this.interval);
          } else {
            window.scrollTo(0, next);
          }
          i++;
        }, 17);
      },
    },
  
    watch: {
      //监听相同路由下参数变化的时候，从而实现异步刷新
      $route() {
        console.log(this.$route.params + "-------------");
        this.article = JSON.parse(localStorage.getItem('wenzxq'));
        
      },
      immediate: true,
    },
  }
  </script>
  
  <style scoped></style>
  